package booklist;
import book.Book;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-10
 * Time: 15:24
 * @author YKH
 */
public class BookList {
    //创建书架数组，用来存放书的信息
    private Book[]books = new Book[10];
    //记录当前书架中书籍的数量
    private int booksize = 0;

    /**
     * 给书架上初始放上三本书
     */
    public BookList() {
        books[0] = new Book("三国演义","吴承恩",54,"小说");
        books[1] = new Book("西游记","罗贯中",78,"小说");
        books[2] = new Book("红楼梦","曹雪芹",66,"小说");
        this.booksize = 3;
    }

    public int getBooksize() {
        return booksize;
    }

    public void setBooksize(int booksize) {
        this.booksize = booksize;
    }
    //获取当前的书籍数组的下标
    public Book getpos(int pos) {
        return books[pos];
    }
    //更改书架数组中的书
    public void setbook(int pos,Book book) {
       books[pos] = book;
    }

}
